#include "satellitehandler.h"
#include "mainwindow.h"
#include <QDebug>
#include <QDateTime>

SatelliteHandler::SatelliteHandler(QTableWidget *tableWidget)
    : tableWidget(tableWidget), rng(std::random_device()()), dist(0, 99) {

}

void SatelliteHandler::displaySatelliteData(const DecoderBD2RAWEPHEMmeo_data &data) {
//void SatelliteHandler::displaySatelliteData() {
     // 获取当前表格的行数
     int rowCount = tableWidget->rowCount();

    if (rowCount >= 200) {
        tableWidget->removeRow(rowCount - 1); // 删除最后一行
    }

     // 将现有的行向下移动一行
     tableWidget->insertRow(rowCount); // 在第一行插入新行

     // 将旧数据向下移动
     for (int row = rowCount; row > 0; --row) {
         for (int col = 0; col < tableWidget->columnCount(); ++col) {
             QTableWidgetItem *item = tableWidget->takeItem(row - 1, col); // 获取旧数据
             tableWidget->setItem(row, col, item); // 将旧数据放到下一行
         }
     }

//    // 将新数据插入到第一行
//    for (int col = 0; col < 42; col++) {
//        qDebug() << "add row: " << col;
//        tableWidget->setItem(0, col, new QTableWidgetItem(data.params[col]));
//    }


int accuracy = 8;
qDebug() << data.time;
    tableWidget->setItem(0, 1, new QTableWidgetItem(QString::number(data.prn)));
    tableWidget->setItem(0, 2, new QTableWidgetItem(QString::number(data.refWeek)));
    tableWidget->setItem(0, 3, new QTableWidgetItem(QString::number(data.refSecs)));
    tableWidget->setItem(0, 4, new QTableWidgetItem(QString::number(data.Pre)));
    tableWidget->setItem(0, 5, new QTableWidgetItem(QString::number(data.Rev)));
    tableWidget->setItem(0, 6, new QTableWidgetItem(QString::number(data.FraID)));
    tableWidget->setItem(0, 7, new QTableWidgetItem(QString::number(data.SOW)));
    tableWidget->setItem(0, 8, new QTableWidgetItem(QString::number(data.checksum1)));
    tableWidget->setItem(0, 9, new QTableWidgetItem(QString::number(data.SatH1)));
    tableWidget->setItem(0, 10, new QTableWidgetItem(QString::number(data.AODC)));
    tableWidget->setItem(0, 11, new QTableWidgetItem(QString::number(data.URA, 'f',accuracy)));
    tableWidget->setItem(0, 12, new QTableWidgetItem(QString::number(data.WN)));
    tableWidget->setItem(0, 13, new QTableWidgetItem(QString::number(data.toc, 'f',accuracy)));
    tableWidget->setItem(0, 14, new QTableWidgetItem(QString::number(data.TGD1)));
    tableWidget->setItem(0, 15, new QTableWidgetItem(QString::number(data.TGD2)));
    tableWidget->setItem(0, 16, new QTableWidgetItem(QString::number(data.alpha0, 'f',accuracy)));
    tableWidget->setItem(0, 17, new QTableWidgetItem(QString::number(data.alpha1, 'f',accuracy)));
    tableWidget->setItem(0, 18, new QTableWidgetItem(QString::number(data.alpha2, 'f',accuracy)));
    tableWidget->setItem(0, 19, new QTableWidgetItem(QString::number(data.alpha3, 'f',accuracy)));
    tableWidget->setItem(0, 20, new QTableWidgetItem(QString::number(data.beta0, 'f',accuracy)));
    tableWidget->setItem(0, 21, new QTableWidgetItem(QString::number(data.beta1, 'f',accuracy)));
    tableWidget->setItem(0, 22, new QTableWidgetItem(QString::number(data.beta2, 'f',accuracy)));
    tableWidget->setItem(0, 23, new QTableWidgetItem(QString::number(data.beta3, 'f',accuracy)));
    tableWidget->setItem(0, 24, new QTableWidgetItem(QString::number(data.a2, 'f',accuracy)));
    tableWidget->setItem(0, 25, new QTableWidgetItem(QString::number(data.a0, 'f',accuracy)));
    tableWidget->setItem(0, 26, new QTableWidgetItem(QString::number(data.a1, 'f',accuracy)));
    tableWidget->setItem(0, 27, new QTableWidgetItem(QString::number(data.AODE)));
    tableWidget->setItem(0, 28, new QTableWidgetItem(QString::number(data.deltaN, 'f',accuracy)));
    tableWidget->setItem(0, 29, new QTableWidgetItem(QString::number(data.Cuc, 'f',accuracy)));
    tableWidget->setItem(0, 30, new QTableWidgetItem(QString::number(data.M0, 'f',accuracy)));
    tableWidget->setItem(0, 31, new QTableWidgetItem(QString::number(data.e, 'f',accuracy)));
    tableWidget->setItem(0, 32, new QTableWidgetItem(QString::number(data.Cus, 'f',accuracy)));
    tableWidget->setItem(0, 33, new QTableWidgetItem(QString::number(data.Crc, 'f',accuracy)));
    tableWidget->setItem(0, 34, new QTableWidgetItem(QString::number(data.Crs, 'f',accuracy)));
    tableWidget->setItem(0, 35, new QTableWidgetItem(QString::number(data.A, 'f',accuracy)));
    tableWidget->setItem(0, 36, new QTableWidgetItem(QString::number(data.toe)));
    tableWidget->setItem(0, 37, new QTableWidgetItem(QString::number(data.i0, 'f',accuracy)));
    tableWidget->setItem(0, 38, new QTableWidgetItem(QString::number(data.Cic, 'f',accuracy)));
    tableWidget->setItem(0, 39, new QTableWidgetItem(QString::number(data.Omega, 'f',accuracy)));
    tableWidget->setItem(0, 40, new QTableWidgetItem(QString::number(data.Cis, 'f',accuracy)));
    tableWidget->setItem(0, 41, new QTableWidgetItem(QString::number(data.IDOT, 'f',accuracy)));
    tableWidget->setItem(0, 42, new QTableWidgetItem(QString::number(data.Omega0, 'f',accuracy)));
    tableWidget->setItem(0, 43, new QTableWidgetItem(QString::number(data.w, 'f',accuracy)));
}


void SatelliteHandler::displaySatelliteDataBDmeo(const DecoderBD2RAWEPHEMmeo_data &data) {//BDmeo卫星显示
     // 获取当前表格的行数
     int rowCount = tableWidget->rowCount();

    if (rowCount >= 200) {
        tableWidget->removeRow(rowCount - 1); // 删除最后一行
    }

     // 将现有的行向下移动一行
     tableWidget->insertRow(rowCount); // 在第一行插入新行

     // 将旧数据向下移动
     for (int row = rowCount; row > 0; --row) {
         for (int col = 0; col < tableWidget->columnCount(); ++col) {
             QTableWidgetItem *item = tableWidget->takeItem(row - 1, col); // 获取旧数据
             tableWidget->setItem(row, col, item); // 将旧数据放到下一行
         }
     }

    int accuracy = 8;
    qDebug() << data.time;
        tableWidget->setItem(0, 0, new QTableWidgetItem(QString(data.time)));
    	tableWidget->setItem(0, 1, new QTableWidgetItem(QString::number(data.prn)));
        tableWidget->setItem(0, 2, new QTableWidgetItem(QString::number(data.refWeek)));
        tableWidget->setItem(0, 3, new QTableWidgetItem(QString::number(data.refSecs)));
        tableWidget->setItem(0, 4, new QTableWidgetItem(QString::number(data.Pre)));
        tableWidget->setItem(0, 5, new QTableWidgetItem(QString::number(data.Rev)));
        tableWidget->setItem(0, 6, new QTableWidgetItem(QString::number(data.FraID)));
        tableWidget->setItem(0, 7, new QTableWidgetItem(QString::number(data.SOW)));
        tableWidget->setItem(0, 8, new QTableWidgetItem(QString::number(data.checksum1)));
        tableWidget->setItem(0, 9, new QTableWidgetItem(QString::number(data.SatH1)));
        tableWidget->setItem(0, 10, new QTableWidgetItem(QString::number(data.AODC)));
        tableWidget->setItem(0, 11, new QTableWidgetItem(QString::number(data.URA, 'f',accuracy)));
        tableWidget->setItem(0, 12, new QTableWidgetItem(QString::number(data.WN)));
        tableWidget->setItem(0, 13, new QTableWidgetItem(QString::number(data.toc, 'f',accuracy)));
        tableWidget->setItem(0, 14, new QTableWidgetItem(QString::number(data.TGD1)));
        tableWidget->setItem(0, 15, new QTableWidgetItem(QString::number(data.TGD2)));
        tableWidget->setItem(0, 16, new QTableWidgetItem(QString::number(data.alpha0, 'f',accuracy)));
        tableWidget->setItem(0, 17, new QTableWidgetItem(QString::number(data.alpha1, 'f',accuracy)));
        tableWidget->setItem(0, 18, new QTableWidgetItem(QString::number(data.alpha2, 'f',accuracy)));
        tableWidget->setItem(0, 19, new QTableWidgetItem(QString::number(data.alpha3, 'f',accuracy)));
        tableWidget->setItem(0, 20, new QTableWidgetItem(QString::number(data.beta0, 'f',accuracy)));
        tableWidget->setItem(0, 21, new QTableWidgetItem(QString::number(data.beta1, 'f',accuracy)));
        tableWidget->setItem(0, 22, new QTableWidgetItem(QString::number(data.beta2, 'f',accuracy)));
        tableWidget->setItem(0, 23, new QTableWidgetItem(QString::number(data.beta3, 'f',accuracy)));
        tableWidget->setItem(0, 24, new QTableWidgetItem(QString::number(data.a2, 'f',accuracy)));
        tableWidget->setItem(0, 25, new QTableWidgetItem(QString::number(data.a0, 'f',accuracy)));
        tableWidget->setItem(0, 26, new QTableWidgetItem(QString::number(data.a1, 'f',accuracy)));
        tableWidget->setItem(0, 27, new QTableWidgetItem(QString::number(data.AODE)));
        tableWidget->setItem(0, 28, new QTableWidgetItem(QString::number(data.deltaN, 'f',accuracy)));
        tableWidget->setItem(0, 29, new QTableWidgetItem(QString::number(data.Cuc, 'f',accuracy)));
        tableWidget->setItem(0, 30, new QTableWidgetItem(QString::number(data.M0, 'f',accuracy)));
        tableWidget->setItem(0, 31, new QTableWidgetItem(QString::number(data.e, 'f',accuracy)));
        tableWidget->setItem(0, 32, new QTableWidgetItem(QString::number(data.Cus, 'f',accuracy)));
        tableWidget->setItem(0, 33, new QTableWidgetItem(QString::number(data.Crc, 'f',accuracy)));
        tableWidget->setItem(0, 34, new QTableWidgetItem(QString::number(data.Crs, 'f',accuracy)));
        tableWidget->setItem(0, 35, new QTableWidgetItem(QString::number(data.A, 'f',accuracy)));
        tableWidget->setItem(0, 36, new QTableWidgetItem(QString::number(data.toe)));
        tableWidget->setItem(0, 37, new QTableWidgetItem(QString::number(data.i0, 'f',accuracy)));
        tableWidget->setItem(0, 38, new QTableWidgetItem(QString::number(data.Cic, 'f',accuracy)));
        tableWidget->setItem(0, 39, new QTableWidgetItem(QString::number(data.Omega, 'f',accuracy)));
        tableWidget->setItem(0, 40, new QTableWidgetItem(QString::number(data.Cis, 'f',accuracy)));
        tableWidget->setItem(0, 41, new QTableWidgetItem(QString::number(data.IDOT, 'f',accuracy)));
        tableWidget->setItem(0, 42, new QTableWidgetItem(QString::number(data.Omega0, 'f',accuracy)));
        tableWidget->setItem(0, 43, new QTableWidgetItem(QString::number(data.w, 'f',accuracy)));
}

void SatelliteHandler::displaySatelliteDataBDgeo(const DecoderBD2RAWEPHEMgeo_data &data) {//BDgeo卫星显示
     // 获取当前表格的行数
     int rowCount = tableWidget->rowCount();

    if (rowCount >= 200) {
        tableWidget->removeRow(rowCount - 1); // 删除最后一行
    }

     // 将现有的行向下移动一行
     tableWidget->insertRow(rowCount); // 在第一行插入新行

     // 将旧数据向下移动
     for (int row = rowCount; row > 0; --row) {
         for (int col = 0; col < tableWidget->columnCount(); ++col) {
             QTableWidgetItem *item = tableWidget->takeItem(row - 1, col); // 获取旧数据
             tableWidget->setItem(row, col, item); // 将旧数据放到下一行
         }
     }

    int accuracy = 8;
    qDebug() << data.time;
        tableWidget->setItem(0, 0, new QTableWidgetItem(QString(data.time)));
        tableWidget->setItem(0, 1, new QTableWidgetItem(QString::number(data.prn)));
        tableWidget->setItem(0, 2, new QTableWidgetItem(QString::number(data.refWeek)));
        tableWidget->setItem(0, 3, new QTableWidgetItem(QString::number(data.refSecs)));
        tableWidget->setItem(0, 4, new QTableWidgetItem(QString::number(data.Pre)));
        tableWidget->setItem(0, 5, new QTableWidgetItem(QString::number(data.Rev)));
        tableWidget->setItem(0, 6, new QTableWidgetItem(QString::number(data.FraID)));
        tableWidget->setItem(0, 7, new QTableWidgetItem(QString::number(data.SOW)));
        tableWidget->setItem(0, 8, new QTableWidgetItem(QString::number(data.checksum1)));
        tableWidget->setItem(0, 9, new QTableWidgetItem(QString::number(data.SatH1)));
        tableWidget->setItem(0, 10, new QTableWidgetItem(QString::number(data.AODC)));
        tableWidget->setItem(0, 11, new QTableWidgetItem(QString::number(data.URA, 'f',accuracy)));
        tableWidget->setItem(0, 12, new QTableWidgetItem(QString::number(data.WN)));
        tableWidget->setItem(0, 13, new QTableWidgetItem(QString::number(data.toc, 'f',accuracy)));
        tableWidget->setItem(0, 14, new QTableWidgetItem(QString::number(data.TGD1)));
        tableWidget->setItem(0, 15, new QTableWidgetItem(QString::number(data.TGD2)));
        tableWidget->setItem(0, 16, new QTableWidgetItem(QString::number(data.alpha0, 'f',accuracy)));
        tableWidget->setItem(0, 17, new QTableWidgetItem(QString::number(data.alpha1, 'f',accuracy)));
        tableWidget->setItem(0, 18, new QTableWidgetItem(QString::number(data.alpha2, 'f',accuracy)));
        tableWidget->setItem(0, 19, new QTableWidgetItem(QString::number(data.alpha3, 'f',accuracy)));
        tableWidget->setItem(0, 20, new QTableWidgetItem(QString::number(data.beta0, 'f',accuracy)));
        tableWidget->setItem(0, 21, new QTableWidgetItem(QString::number(data.beta1, 'f',accuracy)));
        tableWidget->setItem(0, 22, new QTableWidgetItem(QString::number(data.beta2, 'f',accuracy)));
        tableWidget->setItem(0, 23, new QTableWidgetItem(QString::number(data.beta3, 'f',accuracy)));
        tableWidget->setItem(0, 24, new QTableWidgetItem(QString::number(data.a2, 'f',accuracy)));
        tableWidget->setItem(0, 25, new QTableWidgetItem(QString::number(data.a0, 'f',accuracy)));
        tableWidget->setItem(0, 26, new QTableWidgetItem(QString::number(data.a1, 'f',accuracy)));
        tableWidget->setItem(0, 27, new QTableWidgetItem(QString::number(data.AODE)));
        tableWidget->setItem(0, 28, new QTableWidgetItem(QString::number(data.deltaN, 'f',accuracy)));
        tableWidget->setItem(0, 29, new QTableWidgetItem(QString::number(data.Cuc, 'f',accuracy)));
        tableWidget->setItem(0, 30, new QTableWidgetItem(QString::number(data.M0, 'f',accuracy)));
        tableWidget->setItem(0, 31, new QTableWidgetItem(QString::number(data.e, 'f',accuracy)));
        tableWidget->setItem(0, 32, new QTableWidgetItem(QString::number(data.Cus, 'f',accuracy)));
        tableWidget->setItem(0, 33, new QTableWidgetItem(QString::number(data.Crc, 'f',accuracy)));
        tableWidget->setItem(0, 34, new QTableWidgetItem(QString::number(data.Crs, 'f',accuracy)));
        tableWidget->setItem(0, 35, new QTableWidgetItem(QString::number(data.A, 'f',accuracy)));
        tableWidget->setItem(0, 36, new QTableWidgetItem(QString::number(data.toe)));
        tableWidget->setItem(0, 37, new QTableWidgetItem(QString::number(data.i0, 'f',accuracy)));
        tableWidget->setItem(0, 38, new QTableWidgetItem(QString::number(data.Cic, 'f',accuracy)));
        tableWidget->setItem(0, 39, new QTableWidgetItem(QString::number(data.Omega, 'f',accuracy)));
        tableWidget->setItem(0, 40, new QTableWidgetItem(QString::number(data.Cis, 'f',accuracy)));
        tableWidget->setItem(0, 41, new QTableWidgetItem(QString::number(data.IDOT, 'f',accuracy)));
        tableWidget->setItem(0, 42, new QTableWidgetItem(QString::number(data.Omega0, 'f',accuracy)));
        tableWidget->setItem(0, 43, new QTableWidgetItem(QString::number(data.w, 'f',accuracy)));
}

void SatelliteHandler::displaySatelliteDataGPS(const DecoderGPSRAWEPHEM_data &data) {//meo卫星显示
     // 获取当前表格的行数
     int rowCount = tableWidget->rowCount();

    if (rowCount >= 200) {
        tableWidget->removeRow(rowCount - 1); // 删除最后一行
    }

     // 将现有的行向下移动一行
     tableWidget->insertRow(rowCount); // 在第一行插入新行

     // 将旧数据向下移动
     for (int row = rowCount; row > 0; --row) {
         for (int col = 0; col < tableWidget->columnCount(); ++col) {
             QTableWidgetItem *item = tableWidget->takeItem(row - 1, col); // 获取旧数据
             tableWidget->setItem(row, col, item); // 将旧数据放到下一行
         }
     }

    int accuracy = 8;
    qDebug() << data.time;
        tableWidget->setItem(0, 0, new QTableWidgetItem(QString(data.time)));
        tableWidget->setItem(0, 1, new QTableWidgetItem(QString::number(data.prn)));
        tableWidget->setItem(0, 2, new QTableWidgetItem(QString::number(data.refWeek)));
        tableWidget->setItem(0, 3, new QTableWidgetItem(QString::number(data.refSecs)));
        // QString preStr = QString::fromStdString(data.Pre.to_string());
        // tableWidget->setItem(0, 4, new QTableWidgetItem(preStr));
        tableWidget->setItem(0, 4, new QTableWidgetItem(QString::fromStdString(data.Pre.to_string())));
        tableWidget->setItem(0, 5, new QTableWidgetItem(QString::fromStdString(data.TLW.to_string())));
        tableWidget->setItem(0, 6, new QTableWidgetItem(QString::number(data.Rev, 'f',accuracy)));
        tableWidget->setItem(0, 7, new QTableWidgetItem(QString::number(data.SOW, 'f',accuracy)));
        tableWidget->setItem(0, 8, new QTableWidgetItem(QString::number(data.warn, 'f',accuracy)));
        tableWidget->setItem(0, 9, new QTableWidgetItem(QString::number(data.Anti, 'f',accuracy)));
        tableWidget->setItem(0, 10, new QTableWidgetItem(QString::number(data.Z, 'f',accuracy)));
        tableWidget->setItem(0, 11, new QTableWidgetItem(QString::number(data.WN, 'f',accuracy)));
        tableWidget->setItem(0, 12, new QTableWidgetItem(QString::number(data.PCA, 'f',accuracy)));
        tableWidget->setItem(0, 13, new QTableWidgetItem(QString::number(data.URA, 'f',accuracy)));
        tableWidget->setItem(0, 14, new QTableWidgetItem(QString::number(data.SatH1, 'f',accuracy)));
        tableWidget->setItem(0, 15, new QTableWidgetItem(QString::number(data.IODC)));
        tableWidget->setItem(0, 16, new QTableWidgetItem(QString::number(data.P, 'f',accuracy)));
        tableWidget->setItem(0, 17, new QTableWidgetItem(QString::number(data.TGD, 'f',accuracy)));
        tableWidget->setItem(0, 18, new QTableWidgetItem(QString::number(data.toc, 'f',accuracy)));
        tableWidget->setItem(0, 19, new QTableWidgetItem(QString::number(data.af2, 'f',accuracy)));
        tableWidget->setItem(0, 20, new QTableWidgetItem(QString::number(data.af1, 'f',accuracy)));
        tableWidget->setItem(0, 21, new QTableWidgetItem(QString::number(data.af0, 'f',accuracy)));
        tableWidget->setItem(0, 22, new QTableWidgetItem(QString::number(data.IODE, 'f',accuracy)));
        tableWidget->setItem(0, 23, new QTableWidgetItem(QString::number(data.Crs, 'f',accuracy)));
        tableWidget->setItem(0, 24, new QTableWidgetItem(QString::number(data.deltaN, 'f',accuracy)));
        tableWidget->setItem(0, 25, new QTableWidgetItem(QString::number(data.M0, 'f',accuracy)));
        tableWidget->setItem(0, 26, new QTableWidgetItem(QString::number(data.Cuc, 'f',accuracy)));
        tableWidget->setItem(0, 27, new QTableWidgetItem(QString::number(data.e, 'f',accuracy)));
        tableWidget->setItem(0, 28, new QTableWidgetItem(QString::number(data.Cus, 'f',accuracy)));
        tableWidget->setItem(0, 29, new QTableWidgetItem(QString::number(data.A, 'f',accuracy)));
        tableWidget->setItem(0, 30, new QTableWidgetItem(QString::number(data.toe, 'f',accuracy)));
        tableWidget->setItem(0, 31, new QTableWidgetItem(QString::number(data.FIT, 'f',accuracy)));
        tableWidget->setItem(0, 32, new QTableWidgetItem(QString::number(data.AODO, 'f',accuracy)));
        tableWidget->setItem(0, 33, new QTableWidgetItem(QString::number(data.Cic, 'f',accuracy)));
        tableWidget->setItem(0, 34, new QTableWidgetItem(QString::number(data.Omega0, 'f',accuracy)));
        tableWidget->setItem(0, 35, new QTableWidgetItem(QString::number(data.Cis, 'f',accuracy)));
        tableWidget->setItem(0, 36, new QTableWidgetItem(QString::number(data.i0, 'f',accuracy)));
        tableWidget->setItem(0, 37, new QTableWidgetItem(QString::number(data.Crc, 'f',accuracy)));
        tableWidget->setItem(0, 38, new QTableWidgetItem(QString::number(data.w, 'f',accuracy)));
        tableWidget->setItem(0, 39, new QTableWidgetItem(QString::number(data.Omega, 'f',accuracy)));
        tableWidget->setItem(0, 40, new QTableWidgetItem(QString::number(data.IDOE, 'f',accuracy)));
        tableWidget->setItem(0, 41, new QTableWidgetItem(QString::number(data.IDOT, 'f',accuracy)));
}

void SatelliteHandler::displaySatelliteDataGAL(const GALephemeris_data &data) {//伽利略卫星显示
     // 获取当前表格的行数
     int rowCount = tableWidget->rowCount();

    if (rowCount >= 200) {
        tableWidget->removeRow(rowCount - 1); // 删除最后一行
    }

     // 将现有的行向下移动一行
     tableWidget->insertRow(rowCount); // 在第一行插入新行

     // 将旧数据向下移动
     for (int row = rowCount; row > 0; --row) {
         for (int col = 0; col < tableWidget->columnCount(); ++col) {
             QTableWidgetItem *item = tableWidget->takeItem(row - 1, col); // 获取旧数据
             tableWidget->setItem(row, col, item); // 将旧数据放到下一行
         }
     }

    int accuracy = 8;
    qDebug() << data.time;
        tableWidget->setItem(0, 0, new QTableWidgetItem(QString(data.time)));
        tableWidget->setItem(0, 1, new QTableWidgetItem(QString::number(data.satId)));
        tableWidget->setItem(0, 2, new QTableWidgetItem(QString::number(data.FNAVReceived)));
        tableWidget->setItem(0, 3, new QTableWidgetItem(QString::number(data.INAVReceived)));
        tableWidget->setItem(0, 4, new QTableWidgetItem(QString::number(data.E1BHealth)));
        tableWidget->setItem(0, 5, new QTableWidgetItem(QString::number(data.E5aHealth)));
        tableWidget->setItem(0, 6, new QTableWidgetItem(QString::number(data.E5bHealth)));
        tableWidget->setItem(0, 7, new QTableWidgetItem(QString::number(data.E1BDVS)));
        tableWidget->setItem(0, 8, new QTableWidgetItem(QString::number(data.E5aDVS)));
        tableWidget->setItem(0, 9, new QTableWidgetItem(QString::number(data.E5bDVS)));
        tableWidget->setItem(0, 10, new QTableWidgetItem(QString::number(data.SISA)));
        tableWidget->setItem(0, 11, new QTableWidgetItem(QString::number(data.Reserved)));
        tableWidget->setItem(0, 12, new QTableWidgetItem(QString::number(data.IODNav)));
        tableWidget->setItem(0, 13, new QTableWidgetItem(QString::number(data.T0e)));
        tableWidget->setItem(0, 14, new QTableWidgetItem(QString::number(data.RootA, 'f',accuracy)));
        tableWidget->setItem(0, 15, new QTableWidgetItem(QString::number(data.DeltaN,'f',accuracy)));
        tableWidget->setItem(0, 16, new QTableWidgetItem(QString::number(data.M0, 'f',accuracy)));
        tableWidget->setItem(0, 17, new QTableWidgetItem(QString::number(data.Ecc, 'f',accuracy)));
        tableWidget->setItem(0, 18, new QTableWidgetItem(QString::number(data.Omega, 'f',accuracy)));
        tableWidget->setItem(0, 19, new QTableWidgetItem(QString::number(data.Cuc, 'f',accuracy)));
        tableWidget->setItem(0, 20, new QTableWidgetItem(QString::number(data.Cus, 'f',accuracy)));
        tableWidget->setItem(0, 21, new QTableWidgetItem(QString::number(data.Crc, 'f',accuracy)));
        tableWidget->setItem(0, 22, new QTableWidgetItem(QString::number(data.Crs, 'f',accuracy)));
        tableWidget->setItem(0, 23, new QTableWidgetItem(QString::number(data.Cic, 'f',accuracy)));
        tableWidget->setItem(0, 24, new QTableWidgetItem(QString::number(data.Cis, 'f',accuracy)));
        tableWidget->setItem(0, 25, new QTableWidgetItem(QString::number(data.I0, 'f',accuracy)));
        tableWidget->setItem(0, 26, new QTableWidgetItem(QString::number(data.IDot, 'f',accuracy)));
        tableWidget->setItem(0, 27, new QTableWidgetItem(QString::number(data.Omega0, 'f',accuracy)));
        tableWidget->setItem(0, 28, new QTableWidgetItem(QString::number(data.OmegaDot, 'f',accuracy)));
        tableWidget->setItem(0, 29, new QTableWidgetItem(QString::number(data.FNAVT0c)));
        tableWidget->setItem(0, 30, new QTableWidgetItem(QString::number(data.FNAVAf0, 'f',accuracy)));
        tableWidget->setItem(0, 31, new QTableWidgetItem(QString::number(data.FNAVAf1, 'f',accuracy)));
        tableWidget->setItem(0, 32, new QTableWidgetItem(QString::number(data.FNAVAf2, 'f',accuracy)));
        tableWidget->setItem(0, 33, new QTableWidgetItem(QString::number(data.INAVT0c)));
        tableWidget->setItem(0, 34, new QTableWidgetItem(QString::number(data.INAVAf0, 'f',accuracy)));
        tableWidget->setItem(0, 35, new QTableWidgetItem(QString::number(data.INAVAf1, 'f',accuracy)));
        tableWidget->setItem(0, 36, new QTableWidgetItem(QString::number(data.INAVAf2, 'f',accuracy)));
        tableWidget->setItem(0, 37, new QTableWidgetItem(QString::number(data.E1E5aBGD, 'f',accuracy)));
        tableWidget->setItem(0, 38, new QTableWidgetItem(QString::number(data.E1E5bBGD, 'f',accuracy)));
}


